package com.lu.pojo.network;

import java.net.InetSocketAddress;

/**
 * @author luzhenfang
 * @date 2020 05 16
 * @description  网络基础:地址
 */
public class TestSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress socket = new InetSocketAddress("127.0.0.1", 8080);
        // 获取地址和端口
        System.out.println(socket.getAddress());
        System.out.println(socket.getHostName());
        System.out.println(socket.getHostString());
        System.out.println(socket.getPort());
    }
}
